package com.example.loggingservice.service;

import com.example.loggingservice.entity.Log;

import com.example.loggingservice.mapper.LogMapper;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@RocketMQMessageListener(
        topic = "%DLD%log-consumer-group",
        consumerGroup = "dlq-consumer-group"
)
@Service
public class DlqConsumer implements RocketMQListener<Log> {
    Logger logger = LoggerFactory.getLogger(LogRocketMQListener.class);
    @Autowired
    private LogMapper logMapper;
    @Override
    public void onMessage(Log log) {
        logger.warn("收到死信日志消息" + log);

    }
}
